package com.itheima.utils;

import com.alibaba.fastjson.JSON;

import java.util.HashMap;
import java.util.Map;

public class ResultUtils {

    public static String result(Object code, Object data) {
        Map<Object, Object> map = new HashMap<>();
        map.put("code", code);
        map.put("data", data);
        return JSON.toJSONString(map);
    }

    public static String result2(Object success, Object resultCode,Object message) {
        Map<Object, Object> map = new HashMap<>();
        map.put("sucess", success);
        map.put("resultCode", resultCode);
        map.put("message",message);
        return JSON.toJSONString(map);
    }
}